package com.vcit.zhaosheng.student.controller;

import com.vcit.common.core.controller.BaseController;
import com.vcit.common.core.domain.AjaxResult;

import com.vcit.common.core.domain.model.StudentLoginUser;
import com.vcit.framework.web.service.TokenService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 学生招生Controller
 *
 * @author dff
 * @date 2025-04-28
 */
@RestController
@RequestMapping("/student/zhaosheng")
public class ZhaoshengStudentController extends BaseController {

    @Autowired
    private  TokenService tokenService;

    @GetMapping("getInfo")
    @ApiOperation("获取登录学生用户信息")
    public AjaxResult getInfo(HttpServletRequest request) {


        StudentLoginUser user =  tokenService.getStudentLoginUser(request);

        System.out.println (user.getStudent());
        AjaxResult ajax = AjaxResult.success();
        ajax.put("stuUser", user.getStudent());

        return ajax;
    }

}